From b0c9363ed88fa8e5baaa8d741f7744d75451011c Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Wed, 14 Mar 2007 21:04:04 +0000 Subject: [PATCH] Added VM_metrics.get_all. Signed-off-by: Tom Wilkie --- tools/python/xen/xend/XendAPI.py | 3 +++ tools/python/xen/xend/XendVMMetrics.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index 7aadf5f5b1..62f42e8e02 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -1516,6 +1516,9 @@ class XendAPI(object): def _VM_metrics_get(self, ref): return XendVMMetrics.get_by_uuid(ref) + def VM_metrics_get_all(self, _): + return xen_api_success(XendVMMetrics.get_all()) + def VM_metrics_get_record(self, _, ref): return xen_api_success(self._VM_metrics_get(ref).get_record()) diff --git a/tools/python/xen/xend/XendVMMetrics.py b/tools/python/xen/xend/XendVMMetrics.py index 8589e35171..d531411b30 100644 --- a/tools/python/xen/xend/XendVMMetrics.py +++ b/tools/python/xen/xend/XendVMMetrics.py @@ -31,6 +31,11 @@ class XendVMMetrics: return uuid in instances is_valid_vm_metrics = classmethod(is_valid_vm_metrics) + + def get_all(_): + return instances.keys() + + get_all = classmethod(get_all) def __init__(self, uuid, xend_domain_instance): self.uuid = uuid -- 2.30.2